popover.menu {
  > contents {
    min-width: 120px;
  }

  scrollbar.vertical > range > trough > slider {
    min-height: 30px;
  }

  box.inline-buttons {
    padding: 0 $menu_padding;

    button.image-button.model {
      @extend %button_basic_flat;
      min-height: $menuitem_size;
      min-width: $menuitem_size;
      padding: 2px;
      border: none;
      outline: none;
      transition: none;

      &:selected {
        background-color: $selected_color;

        &:active {
          background-color: $selected_active_color;
        }
      }
    }
  }

  box.circular-buttons {
    padding: $menu_padding $menu_padding $base_padding;

    button.circular.image-button.model {
      @extend %button_basic_flat;
      outline: none;
      padding: $base_padding * 2;
      box-shadow: inset 0 0 0 1px $border_color;

      &:selected {
        background-color: $selected_hover_color;

        &:active {
          background-color: $selected_active_color;
        }
      }
    }
  }

  > contents {
    padding: 0;

    &, > scrolledwindow > viewport {
      > stack > box {
        padding: $menu_margin;
      }
    }
  }

  separator {
    margin: $base_padding 0;
  }

  list separator {
    margin: 0;
  }

  accelerator {
    color: gtkalpha(currentColor, $dim_label_opacity);

    &:dir(ltr) { margin-left: $menu_padding; }
    &:dir(rtl) { margin-right: $menu_padding; }
  }

  check,
  radio {
    min-width: 16px;
    min-height: 16px;
    -gtk-icon-size: 16px;
    padding: 0;

    &,
    &:hover:checked,
    &:hover:indeterminate,
    &:hover:not(:checked):not(:indeterminate),
    &:active:checked,
    &:active:indeterminate,
    &:active:not(:checked):not(:indeterminate), {
      background: none;
      box-shadow: none;
      color: inherit;
    }
  }

  radio {
    &:checked, &:indeterminate { -gtk-icon-source: -gtk-scaled(-gtk-recolor(url("assets/menu-radio-symbolic.svg")), -gtk-recolor(url("assets/menu-radio-symbolic@2.svg"))); }
  }

  .osd & {
    check, radio {
      background: none;
      color: inherit;
    }
  }

  radio, check {
    padding: 0;
    border: 1px solid gtkalpha(currentColor, $dimmer_opacity);
  }

  check,
  radio,
  arrow {
    &.left {
      margin-left: -2px;
      margin-right: $base_padding;
    }

    &.right {
      margin-left: $base_padding;
      margin-right: -2px;
    }
  }

  modelbutton {
    min-height: $menuitem_size;
    min-width: $medium_size + 4px;
    padding: 2px $menu_padding;
    border-radius: $menuitem_radius;
    @include button(flat-normal);

    &:focus:not(:hover):not(:active) {
      outline: none;
      background: none;
      transition: none;
    }

    &:hover,
    &:selected { @include button(flat-hover); }

    &:active { @include button(flat-active); }

    arrow {
      background: none;
      min-width: 16px;
      min-height: 16px;
      opacity: $dimmer_opacity;

      &:hover { background: none; }

      &:disabled {
        filter: opacity($disabled_opacity);
      }

      &.left { -gtk-icon-source: -gtk-icontheme("go-previous-symbolic"); }

      &.right { -gtk-icon-source: -gtk-icontheme("go-next-symbolic"); }
    }
  }

  label.title {
    font-weight: bold;
    padding: 4px ($menu_padding + 20px); //this will fall apart with font sizing
  }

  list, listview {
    background: none;
    color: inherit;

    > row {
      border-radius: $menuitem_radius;
      padding: 0 $menu_padding;
      min-height: $menuitem_size;
      min-width: $large_size;

      &:selected {
        background: none;
      }

      &:hover {
        &, &:selected.activatable {
          background-color: $selected_color;
        }
      }

      &:active {
        &, &:selected.activatable {
          background-color: $selected_active_color;
        }
      }

      &.has-open-popup {
        &, &:selected.activatable {
          background-color: $selected_color;
        }
      }

      > box {
        border-spacing: $base_padding;
      }
    }
  }

  // Standalone lists should have same margins as menu sections,
  // but we don't want that on lists inside sections themselves
  contents > list,
  contents > listview,
  scrolledwindow > viewport > list,
  scrolledwindow > listview {
    padding: $menu_margin 0; //only vertical padding. horizontal row size would clip

    > row {
      margin: 0 $menu_margin;

      padding: $base_padding $menu_padding;
      min-height: 0;
    }
  }
}

menubar {
  box-shadow: inset 0 -1px $border_color;
  padding-bottom: 1px;

  > item {
    min-height: 16px;
    padding: $base_padding - 2px $base_padding + 2px;
    border-radius: $button_radius;

    &:selected { //Seems like it :hover even with keyboard focus
      background-color: $selected_color;
    }

    //nested submenus
    popover.menu popover.menu {
      padding: 0 0 $base_margin 0;
    }

    popover.menu popover.menu > contents {
      margin: 0;
      border-radius: $popover_radius; //including top
    }
  }
}

%menubar-inline {
  box-shadow: none;
  padding-bottom: 0;
}

%menubar-shrunk {}
